<template>
  <div class="dashboard-container">
    <div class="dashboard-text">name: {{ name }}</div>
    <div>{{ createdData }}</div>
    <button @click="abc">触发update</button>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  name: 'Dashboard',
  data() {
    return {
      createdData: ''
    }
  },
  computed: {
    ...mapGetters([
      'name'
    ])
  },
  created() {
    // console.log('created被触发了')
    this.createdData = '123123'
  },
  beforeUpdate() {
    // console.log('beforeUpdate被触发了')
  },
  updated() {
    // console.log('updatede被触发了')
  },
  methods: {
    abc() {
      this.createdData = '456'
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
